package HomeWork;

public class Work_3 {
    public static void main(String[] args) {
        Worker worker=new Worker("zhangsan",900,30);
        worker.print();
      Manager worker2=new Manager("卢布",500,20);
        worker2.print();
       Staff worker3=new Staff("咸鱼",100,30);
        worker3.print();

    }
}

class Worker{
    private String name;
    private double cage;
    private int day;

    public Worker(String name, double cage, int day) {
        this.name = name;
        this.cage = cage;
        this.day = day;
    }

    public double getCage() {
        return cage;
    }

    public void setCage(double cage) {
        this.cage = cage;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public void print(){
     double sum=cage*day;
        System.out.println(sum);


    }
}

class Manager extends Worker{
    public Manager(String name, double cage, int day) {
        super(name, cage, day);
    }


    public void print() {
        double sum=getCage()*getDay()*1.2+1000;
        System.out.println(sum);
    }
}
class Staff extends Worker{
    public Staff(String name, double cage, int day) {
        super(name, cage, day);
    }
    public void print(){
        double sum=getCage()*getDay();
        System.out.println(sum);
    }
}
